package optional;
/**
 * Title: Part5 class for CSIS 235 Lab 3
 * Description: CS 235 Lab #3 - Part 5
 *              File I/O and Multiple Classes.
 * @author Anthony Varghese
 * @email  your.n.here@my.uwrf.edu
 * @date   September 13th 2012
 */

public class Part5 {
	/**
	 * Data members
	 *  The static String named "filename" is used to hold the name of
	 *   the file that we will read from.
	 *       ** Note that when using Eclipse this file will be in the
	 *       ** package folder and not in the Project or src folders.
	 *       
	 *  The static PrintStream object named "out" is used for convenience - 
	 *   it is not really necessary. 
	 */
	private final static String folder   = "src/optional/";
	private final static String infilename  = folder + "LargeData.txt";
	private final static String outfilename = folder + "Sorted.txt";

	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) {
		/*
		 * Read data from a file into a DataContainer object.
		 */
		DataContainer listdata = new DataContainer( infilename );
		
		System.out.println( "Input Data:\n" + listdata );
		
		listdata.sortByRank();
		
		System.out.println( "\n\nSorted by rank:\n" + listdata.output() );
		
		listdata.writeToFile( outfilename );
	}

}
